package com.itheima.reggie.dao;

import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorDao {

    // 批量插入

    void batchSave(@Param("flavorList") List<DishFlavor> flavorList);

    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> findByDishId(Long id);

    // 根据菜品id删除口味信息
    @Delete("delete from dish_flavor where dish_id =#{id}")
    void deleteByDishId(Long id);
}
